wayland: Destroy xdg_surface after role
authorJonas Ådahl <jadahl@gmail.com>
Sun, 5 Mar 2023 19:54:40 +0000 (20:54 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Sun, 5 Mar 2023 19:55:41 +0000 (20:55 +0100)
The split-up of gdksurface-wayland.c introduced a protocol violation
when it didn't make sure xdg_surface was destroyed after the role
objects (xdg_popup / xdg_toplevel). Fix that.

Fixes: 2a463baed0 ("wayland: Rearrange the surface code")
gdk/wayland/gdksurface-wayland.c

index 7571c6aa5593a9f3e26b05dc9e819701849ab9be..21488fc987b5f22650ee9e955097ca72d35df4cc 100644 (file)
@@ -971,6 +971,15 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface)
           impl->display_server.egl_window = NULL;
         }
 
+      impl->awaiting_frame = FALSE;
+      if (impl->awaiting_frame_frozen)
+        {
+          impl->awaiting_frame_frozen = FALSE;
+          gdk_surface_thaw_updates (surface);
+        }
+
+      GDK_WAYLAND_SURFACE_GET_CLASS (impl)->hide_surface (impl);
+
       if (impl->display_server.xdg_surface)
         {
           xdg_surface_destroy (impl->display_server.xdg_surface);
@@ -989,15 +998,6 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface)
             impl->initial_configure_received = FALSE;
         }
 
-      impl->awaiting_frame = FALSE;
-      if (impl->awaiting_frame_frozen)
-        {
-          impl->awaiting_frame_frozen = FALSE;
-          gdk_surface_thaw_updates (surface);
-        }
-
-      GDK_WAYLAND_SURFACE_GET_CLASS (impl)->hide_surface (impl);
-
       g_clear_pointer (&impl->display_server.wl_surface, wl_surface_destroy);
 
       g_slist_free (impl->display_server.outputs);